package com.itheima.demo02;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class MainDemo07 {
    public static void main(String[] args) {
        String str = "2020年12月11日 12:13:14";
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        LocalDateTime parse = LocalDateTime.parse(str, pattern);
        System.out.println(parse);

        LocalDateTime localDateTime = LocalDateTime.of(2020,3,2,10,11,12);
        System.out.println(localDateTime.toLocalDate());
        System.out.println(localDateTime.toLocalTime());
        String format = pattern.format(localDateTime);
        System.out.println(format);
    }
}
